package cn.niit.letuseatdemo.controller.user;
import cn.niit.letuseatdemo.entity.domain.UserOrderDetail;
import cn.niit.letuseatdemo.entity.vo.response.BaseResponse;
import cn.niit.letuseatdemo.service.UserOrderDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: JinNa ToDo
 * @Date: 2022/11/10/14:41
 * @Description:订单详细信息
 */
@Slf4j
@Controller
@RequestMapping("/api/order/orderDetail")
public class UserOrderDetailController {
    @Autowired
    private UserOrderDetailService userOrderDetailService;

    /*
    * @Description: 查询订单详情
    * @Author: Jin_Na
    * @CreateTime: 2022/12/6 11:27
     * @return: java.util.Map<java.lang.String,java.lang.Object>
    **/
    @GetMapping("/{orderId}")
    public BaseResponse selectByUserDetail(@PathVariable("orderId") Integer orderId){
        UserOrderDetail userOrderDetail = userOrderDetailService.selectUserOrderDetailByOrderId(orderId);
        return BaseResponse.success(userOrderDetail);
    }
}
